package com.zxc.dao;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

import org.apache.log4j.Logger;

public class BaseDAO {
	private static final Logger log = Logger.getLogger(BaseDAO.class);
	protected void releaseResource(Connection con, Statement st, ResultSet rs) throws SQLException {
		if (rs != null) {
			try {
				rs.close();
			} catch (SQLException e) {
				log.info(e);
				throw e;
			}
		} 
	
		if (st != null) {
			try {
				st.close();
			} catch (SQLException e) {
				log.info(e);
				throw e;
			}
		}
	
		if (con != null) {
			try {
				con.close();
			} catch (SQLException e) {
				log.info(e);
				throw e;
			}
		}
	}


}
